package com.xiaoxin.codesandbox.errorCode;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 越权执行程序
 */
public class ProcessError {
    public static void main(String[] args) throws IOException, InterruptedException {
        String user = System.getProperty("user.dir");
        String processFile=user+ File.separator+"src/main/resources/木马.bat";
        Process exec = Runtime.getRuntime().exec(processFile);
        exec.waitFor();
        BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(exec.getInputStream()));
        String s="";
        while((s=bufferedReader.readLine())!=null){
            System.out.println(s);
        }
    }
}
